﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
namespace SmartRoute.Data
{
    [Serializable]
    /// <summary>
    /// The type of students taken by a school.
    /// </summary>
    public enum SchoolType
    {
        Elementary,
        Middle,
        JuniorHigh,
        High
    }

    [Serializable]
    /// <summary>
    /// Describes a school that can be placed on a map.
    /// </summary>
    public struct School
    {

        #region Fields

        private string _address;

        private string _name;

        private SchoolType _schoolType;

        private DateTime _startingBell;

        private DateTime _endingBell;

        #endregion

        /// <summary>
        /// Constructs a new School data structure.
        /// </summary>
        /// <param_name="name">The _name of the school.</param>
        /// <param_name="address">The _address where the school is located.</param>
        /// <param_name="schoolType">The kind of students who attend this school.</param>
        /// <param_name="startingBell">When this school comes in session.</param>
        /// <param_name="endingBell">When this school releases its students.</param>
        public School(string name, string address, SchoolType schoolType, DateTime startingBell,
            DateTime endingBell)
        {
            _address = address;
            _name = name;
            _schoolType = schoolType;
            _startingBell = startingBell;
            _endingBell = endingBell;
        }

        /// <summary>
        /// What kind of students attend this school.
        /// </summary>
        public SchoolType SchoolType
        {
            get { return _schoolType; }
            set { _schoolType = value; }
        }

        /// <summary>
        /// When students should be delivered to this school.
        /// </summary>
        public DateTime StartingBell
        {
            get { return _startingBell; }
            set { _startingBell = value; }
        }

        /// <summary>
        /// When buses have to be available to pick up students.
        /// </summary>
        public DateTime EndingBell
        {
            get { return _endingBell; }
            set { _endingBell = value; }
        }

        /// <summary>
        /// The _name of the school.
        /// </summary>
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        /// <summary>
        /// The _address of the school, used to generate the map.
        /// </summary>
        public string Address
        {
            get { return _address; }
        }
    }
}